package me.jzn.alib.drawable;

import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;
import android.widget.RemoteViews;

import androidx.annotation.IdRes;

public class DefaultDrawableType implements DrawableType {
    private Drawable drawable;

    public DefaultDrawableType(Drawable drawable) {
        this.drawable = drawable;
    }

    public Drawable getDrawable() {
        return drawable;
    }

    @Override
    public void setImageView(ImageView iv) {
        iv.setImageDrawable(drawable);
    }

    @Override
    public void setBackground(View view) {
        view.setBackground(drawable);
    }

    @Deprecated
    @Override
    public void setRemoteViews(RemoteViews rv, @IdRes int imageViewId) {
        throw new UnsupportedOperationException("remoteviews不支持drawable类型");
    }
}
